package com.zzj.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class ErrorController {

    @RequestMapping("/e1")
    public String e1(){
        return "ok";
    }

    @ExceptionHandler
    public String error(Model model,Exception e){
        model.addAttribute("msg","局部异常...");
        return "error";
    }
}
